package com.doudou.collection.mapper;

import com.doudou.collection.pojo.entity.Announcement;
import com.doudou.collection.pojo.vo.AnnouncementEditVO;
import com.doudou.collection.pojo.vo.AnnouncementVO;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AnnouncementMapper {
    /**
     * 发布公告
     * @param announcement
     */
    void insertAnnouncement(Announcement announcement);

    /**
     * 查询所有公告
     * @return
     */
    List<AnnouncementVO> selectAll();

    /**
     * 查询要编辑的公告
     * @param id
     * @return
     */
    AnnouncementEditVO selectByIdForEdit(Long id);

    /**
     * 更新公告
     * @param announcement
     */
    void updateAnnouncement(Announcement announcement);

    /**
     * 修改撤回状态
     * @param announcement
     */
    void updateIfCancel(Announcement announcement);

    /**
     * 修改删除状态
     * @param announcement
     */
    void updateDelFlag(Announcement announcement);
}
